diff --git a/docker-compose.yml b/docker-compose.yml index f7d4da7..7c6c6ba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,9 @@ services: build: context: ./webapp dockerfile: Dockerfile + args: + - VITE_SERVER_INTERNAL=http://server:8080 + - VITE_BRANDING=Noteshare.space [preview] ports: - "3000:3000" @@ -28,6 +31,9 @@ services: environment: - DATABASE_URL=file:/database/db.sqlite - FRONTEND_URL=http://localhost:3000 + - CLEANUP_INTERVAL_SECONDS=600 + - POST_LIMIT_WINDOW_SECONDS=86400 + - POST_LIMIT=50 depends_on: - migrate diff --git a/server/.dockerignore b/server/.dockerignore index af54d5f..6550525 100644 --- a/server/.dockerignore +++ b/server/.dockerignore @@ -1,3 +1,5 @@ node_modules npm-debug.log -build \ No newline at end of file +build +.env +.env.* \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile index 9c979d0..a479ae4 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,5 +1,6 @@ FROM node:16-alpine AS BUILD_IMAGE + # install dependencies WORKDIR /app COPY package.json package-lock.json ./ @@ -7,7 +8,6 @@ RUN npm ci # Copy all local files into the image. COPY . . -COPY .env.docker .env RUN npx prisma generate @@ -20,9 +20,8 @@ FROM node:16-alpine WORKDIR /app COPY --from=0 /app . -# COPY . . -ENV PORT=8080 +ENV PORT 8080 EXPOSE 8080 CMD ["node", "./build/server.js"] \ No newline at end of file diff --git a/webapp/.dockerignore b/webapp/.dockerignore index 5171c54..f55a95c 100644 --- a/webapp/.dockerignore +++ b/webapp/.dockerignore @@ -1,2 +1,4 @@ node_modules -npm-debug.log \ No newline at end of file +npm-debug.log +.env +.env.* \ No newline at end of file diff --git a/webapp/Dockerfile b/webapp/Dockerfile index ca7cc46..8320c64 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -1,5 +1,7 @@ FROM node:16-alpine AS BUILD_IMAGE +ARG VITE_SERVER_INTERNAL $VITE_SERVER_INTERNAL +ARG VITE_BRANDING $VITE_BRANDING # install dependencies WORKDIR /app @@ -9,9 +11,6 @@ RUN npm ci # Copy all local files into the image. COPY . . -ENV VITE_SERVER_INTERNAL="http://server:8080" -ENV VITE_BRANDING="Noteshare.space" - RUN npm run build # remove development dependencies