Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.dockerignore
docker-compose.yml
Dockerfile
admin-ui/build/
admin-ui/node_modules/
admin-ui/.env
admin-ui/.gitignore
server/dist/
server/node_modules/
server/.env
server/.gitignore
server/.prettierignore
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The variables in this file are only used by docker-compose for local docker deployment
POSTGRESQL_USER=admin
POSTGRESQL_PASSWORD=admin
POSTGRESQL_PORT=5432
SERVER_PORT=3000
BCRYPT_SALT=10
JWT_SECRET_KEY=Change_ME!!!
JWT_EXPIRATION=2d
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Use node as the base image
FROM node:16.13.1-alpine3.14 as builder

# Define how verbose should npm install be
ARG NPM_LOG_LEVEL=silent
# Hide Open Collective message from install logs
ENV OPENCOLLECTIVE_HIDE=1
# Hiden NPM security message from install logs
ENV NPM_CONFIG_AUDIT=false
# Hide NPM funding message from install logs
ENV NPM_CONFIG_FUND=false

# Update npm to version 7
RUN npm i -g npm@8.1.2

# Set the working directory
WORKDIR /app

# Copy files specifying dependencies
COPY server/package.json server/package-lock.json ./server/
COPY admin-ui/package.json admin-ui/package-lock.json ./admin-ui/

# Install dependencies
RUN cd server; npm ci --loglevel=$NPM_LOG_LEVEL;
RUN cd admin-ui; npm ci --loglevel=$NPM_LOG_LEVEL;

# Copy Prisma schema
COPY server/prisma/schema.prisma ./server/prisma/

# Generate Prisma client
RUN cd server; npm run prisma:generate;

# Copy all the files
COPY . .

# Build code
RUN set -e; (cd server; npm run build) & (cd admin-ui; npm run build)

# Expose the port the server listens to
EXPOSE 3000

# Make server to serve admin built files
ENV SERVE_STATIC_ROOT_PATH=admin-ui/build

# Run server
CMD [ "node", "server/dist/main"]
2 changes: 2 additions & 0 deletions admin-ui/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PORT=3001
SKIP_PREFLIGHT_CHECK=true
23 changes: 23 additions & 0 deletions admin-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading