Merge branch 'dev' into feature-user-auth

This commit is contained in:
Stefan
2021-11-17 15:36:09 +01:00
committed by GitHub
4 changed files with 55 additions and 7 deletions
+2
View File
@@ -0,0 +1,2 @@
*.env
dist/
+30
View File
@@ -0,0 +1,30 @@
# Dockerfile for the event management server
FROM node:17-alpine3.12
# Create directory for the app
RUN mkdir /app
# Copy dependency files
COPY package.json package-lock.json /app/
# Change directory into the container
WORKDIR /app
# Install dependencies
RUN npm i -g typescript
RUN npm i
# Selectively copy the required files and directories
ADD prisma/ /app/prisma/
ADD scripts/ /app/scripts/
ADD src/ /app/src/
COPY tsconfig.json /app/
# Generate the prisma client
RUN npx prisma generate
# Compile TypeScript to JavaScript
RUN tsc
CMD ["sh", "scripts/docker-entrypoint.sh"]
+12 -7
View File
@@ -14,15 +14,20 @@ services:
image: postgres image: postgres
restart: always restart: always
environment: environment:
- POSTGRES_USER=server
- POSTGRES_PASSWORD=${DATABASE_PASSWORD} - POSTGRES_PASSWORD=${DATABASE_PASSWORD}
ports:
- 5432:5432
container_name: "postgres" container_name: "postgres"
redis: redis:
image: redis image: redis
restart: always restart: always
server:
#server: build: .
# build: . restart: always
# restart: always container_name: "server"
# container_name: "server" ports:
- ${PORT:-3000}:${PORT:-3000}
environment:
- PORT=${PORT:-3000}
- DATABASE_URL=postgresql://server:${DATABASE_PASSWORD}@postgres:5432/management?schema=public
- DATABASE_USER=server
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
+11
View File
@@ -0,0 +1,11 @@
# Entry point for docker
if ! test -f INITIALIZED; then
# Migrate the database
# TODO: Update to use prisma migrate
npx prisma db push
touch INITIALIZED
fi
# Start the server
node ./dist/app.js