adjust docker container

This commit is contained in:
Torben Haack
2024-10-09 13:47:03 +02:00
parent 1e63ad5b52
commit 0b8be6c6a0
2 changed files with 4 additions and 6 deletions

View File

@@ -6,7 +6,6 @@ RUN mkdir -p /usr/src/app
# Set environment variables
ENV PORT 3000
ENV NEXT_TELEMETRY_DISABLED=1
ENV RUNTIME_ENVIRONMENT=development
ENV OAUTH_CLIENT_ID=client_id
ENV OAUTH_CLIENT_SECRET=client_secret
@@ -25,7 +24,7 @@ RUN pnpm install
# Copy the rest of the application code
COPY . /usr/src/app
# Initialize Database
# Initialize Database, if it not already exists
RUN pnpm run db
# Build the application
@@ -34,4 +33,4 @@ RUN pnpm run build
EXPOSE 3000
# Start the application
CMD ["pnpm", "start"]
CMD ["/bin/sh", "-c", "if [ ! -f ./db/sqlite.db ]; then pnpm db; fi && pnpm start"]