GPTcord/Dockerfile

32 lines
626 B
Text
Raw Permalink Normal View History

2023-09-18 11:26:37 +02:00
FROM node:18
WORKDIR /app
# Packages
COPY package*.json ./
RUN npm install -D
# Database schema
COPY schema.prisma .
RUN npx prisma generate
# Typescript compiling
COPY tsconfig.json .
COPY src ./src
COPY scripts ./scripts
2023-09-18 11:26:37 +02:00
RUN npx tsc
# Permissions for dist directory,
# so config.ts can be compiled there during runtime
# regardless of the user of the container
RUN chmod 777 dist
2024-04-26 06:14:57 +02:00
# Create a db directory for sqlite database file
# it is required because in order to write to sqlite file
# the directory must be writable
RUN mkdir /db
RUN chmod 777 /db
2023-09-18 11:26:37 +02:00
# Run the app
CMD ["node", "dist/src/index.js"]
STOPSIGNAL SIGINT