tidy up env vars

This commit is contained in:
Maxime Cannoodt 2022-07-02 21:14:07 +02:00
parent 1a2cb003b3
commit 863918cc4f
5 changed files with 16 additions and 8 deletions

View File

@ -5,6 +5,9 @@ services:
build: build:
context: ./webapp context: ./webapp
dockerfile: Dockerfile dockerfile: Dockerfile
args:
- VITE_SERVER_INTERNAL=http://server:8080
- VITE_BRANDING=Noteshare.space [preview]
ports: ports:
- "3000:3000" - "3000:3000"
@ -28,6 +31,9 @@ services:
environment: environment:
- DATABASE_URL=file:/database/db.sqlite - DATABASE_URL=file:/database/db.sqlite
- FRONTEND_URL=http://localhost:3000 - FRONTEND_URL=http://localhost:3000
- CLEANUP_INTERVAL_SECONDS=600
- POST_LIMIT_WINDOW_SECONDS=86400
- POST_LIMIT=50
depends_on: depends_on:
- migrate - migrate

View File

@ -1,3 +1,5 @@
node_modules node_modules
npm-debug.log npm-debug.log
build build
.env
.env.*

View File

@ -1,5 +1,6 @@
FROM node:16-alpine AS BUILD_IMAGE FROM node:16-alpine AS BUILD_IMAGE
# install dependencies # install dependencies
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
@ -7,7 +8,6 @@ RUN npm ci
# Copy all local files into the image. # Copy all local files into the image.
COPY . . COPY . .
COPY .env.docker .env
RUN npx prisma generate RUN npx prisma generate
@ -20,9 +20,8 @@ FROM node:16-alpine
WORKDIR /app WORKDIR /app
COPY --from=0 /app . COPY --from=0 /app .
# COPY . .
ENV PORT=8080 ENV PORT 8080
EXPOSE 8080 EXPOSE 8080
CMD ["node", "./build/server.js"] CMD ["node", "./build/server.js"]

View File

@ -1,2 +1,4 @@
node_modules node_modules
npm-debug.log npm-debug.log
.env
.env.*

View File

@ -1,5 +1,7 @@
FROM node:16-alpine AS BUILD_IMAGE FROM node:16-alpine AS BUILD_IMAGE
ARG VITE_SERVER_INTERNAL $VITE_SERVER_INTERNAL
ARG VITE_BRANDING $VITE_BRANDING
# install dependencies # install dependencies
WORKDIR /app WORKDIR /app
@ -9,9 +11,6 @@ RUN npm ci
# Copy all local files into the image. # Copy all local files into the image.
COPY . . COPY . .
ENV VITE_SERVER_INTERNAL="http://server:8080"
ENV VITE_BRANDING="Noteshare.space"
RUN npm run build RUN npm run build
# remove development dependencies # remove development dependencies