Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use environment variables in Dockerfile ENTRYPOINT #116

Merged
merged 1 commit into from
Oct 6, 2024
Merged
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
32 changes: 17 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM node:20.16.0-alpine3.20 AS build-stage

RUN set -eux \
&& mkdir -p /app \
&& mkdir -p /api \
&& mkdir -p /tasks
&& mkdir -p /app \
&& mkdir -p /api \
&& mkdir -p /tasks

COPY frontend/ /app

WORKDIR /app
RUN set -eux \
&& npm ci \
&& npm run build
&& npm ci \
&& npm run build

COPY backend/ /api/

WORKDIR /api
RUN set -eux \
&& npm ci
&& npm ci

FROM alpine:3.20 AS final
ARG PUID=0
Expand All @@ -35,7 +35,7 @@ ENV PORT=8080
USER root

RUN set -eux \
&& apk add --no-cache nodejs npm
&& apk add --no-cache nodejs npm

RUN mkdir /stylesheets

Expand All @@ -48,11 +48,13 @@ VOLUME /tasks
VOLUME /config
WORKDIR /api
EXPOSE 8080
ENTRYPOINT mkdir -p /config/stylesheets/ && \
mkdir -p /config/images/ && \
mkdir -p /config/sort/ && \
cp -r /config/stylesheets/. /stylesheets/ && \
cp -r /stylesheets/. /config/stylesheets/ && \
chown -R $PUID:$PGID /config && \
chown -R $PUID:$PGID /tasks && \
node /api/server.js


ENTRYPOINT mkdir -p ${CONFIG_DIR}/stylesheets/ && \
mkdir -p ${CONFIG_DIR}/images/ && \
mkdir -p ${CONFIG_DIR}/sort/ && \
cp -r ${CONFIG_DIR}/stylesheets/. /stylesheets/ && \
cp -r /stylesheets/. ${CONFIG_DIR}/stylesheets/ && \
chown -R $PUID:$PGID ${CONFIG_DIR} && \
chown -R $PUID:$PGID ${TASKS_DIR} && \
node /api/server.js