diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ab31dac --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.gitignore +node_modules +front/node_modules +front/dist +back/tmp +*.log +.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..359567c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM oven/bun:1-alpine AS frontend-builder + +WORKDIR /app/front + +COPY front/package.json front/bun.lock ./ +RUN bun install --frozen-lockfile + +COPY front/ ./ +RUN bun run build + + +FROM golang:1.25-alpine AS backend-builder + +WORKDIR /app/back + +COPY back/go.mod back/go.sum ./ +RUN go mod download + +COPY back/ ./ + +RUN go build -o iknowyou ./cmd/server + + +FROM alpine:latest + +WORKDIR /app + +RUN apk add --no-cache ca-certificates + +COPY --from=backend-builder /app/back/iknowyou . +COPY --from=frontend-builder /app/front/dist ./static + +EXPOSE 8080 + +ENV IKY_PORT=8080 +ENV IKY_FRONT_DIR=/app/static + +CMD ["./iknowyou"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..78b03a5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + iknowyou: + build: . + container_name: iknowyou + ports: + - "8080:8080" + restart: unless-stopped \ No newline at end of file