diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dca7346 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY package*.json /app/ + +RUN npm ci + +COPY . . + +ENV NODE_BUILD=true + +RUN npm run build + +EXPOSE 3000 + +CMD node build + +FROM node:18-alpine as production + +COPY --from=builder ./build . + +ENV NODE_ENV=production + +EXPOSE 3000 + +CMD node ./build diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..08a2b09 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,19 @@ +version: '3.1' +services: + app: + build: + dockerfile: Dockerfile + target: production + restart: always + ports: + - 5173:5173 + environment: + - AUTH_SECRET=${AUTH_SECRET} + - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID} + - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET} + - DB_HOST=${DB_HOST} + - DB_USER=${DB_USER} + - DB_PASSWORD=${DB_PASSWORD} + - DB_NAME=${DB_NAME} + - DB_PORT=${DB_PORT} + - DATABASE_URL=${DATABASE_URL} \ No newline at end of file