aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorLauri Vuorela <lauri.vuorela@gmail.com>2024-01-29 01:30:26 +0100
committerGitHub <noreply@github.com>2024-01-28 19:30:26 -0500
commit9759f61e0e77fbd888e91f22c5dce14854830a1b (patch)
tree976d74515d9cf8129aae9d722afe75f6c7a2a144 /Dockerfile
parentd43e731fe191d7e35d96847fe095c94555dd8ca6 (diff)
Production target for Dockerfile (#57)
* add production build * add back updates and use slim image * udpate command * ignore scripts * add workdir * fix workdirs * docker image improvements * use .example instead * use dummy data instead * remove unused env var and add comment * fix entrypoints * change name of script and add possibility for different commands * change to safer default for volume * add instructions for the dev docker container * update copy * add empty lines under topics to keep uniformity * most RUN's in a single command * add comment about volumes for dev target * remove dev workflow * remove dev workflow from readme * Prettify README --------- Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 files changed, 11 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index 0966017..d31173b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,17 +1,22 @@
-FROM node:slim
+FROM node:21-slim as base
EXPOSE 3000/tcp
WORKDIR /usr/app
COPY ./ ./
-SHELL ["/bin/bash", "-c"]
-
RUN apt update && \
apt install openssl -y && \
apt clean && \
apt autoclean && \
apt autoremove && \
- npm install --ignore-scripts && \
- npm install -g prisma
+ npm ci --ignore-scripts && \
+ npm install -g prisma && \
+ prisma generate
+
+# env vars needed for build not to fail
+ARG POSTGRES_PRISMA_URL
+ARG POSTGRES_URL_NON_POOLING
+
+RUN npm run build
-ENTRYPOINT ["/bin/bash", "-c", "scripts/image-startup.sh"]
+ENTRYPOINT ["/usr/app/scripts/container-entrypoint.sh"]