Skip to content

Commit 18b47c5

Browse files
committed
made dockerfile nicer
1 parent fb634a6 commit 18b47c5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ COPY package.json package-lock.json /opt/conditional/
2424
COPY build*.js /opt/conditional
2525
COPY frontend /opt/conditional/frontend
2626

27-
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm use --delete-prefix $NODE_VERSION && npm ci && npm run build"
27+
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && npm ci"
28+
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && npm run build"
2829

29-
FROM docker.io/python:3.12-bookworm
30+
FROM docker.io/python:3.12-slim-bookworm
3031
MAINTAINER Computer Science House <webmaster@csh.rit.edu>
3132

3233
RUN mkdir /opt/conditional
@@ -40,9 +41,13 @@ RUN apt-get -yq update && \
4041
pip install -r requirements.txt && \
4142
apt-get -yq clean all
4243

43-
ADD . /opt/conditional
44+
ARG PORT=8080
45+
ENV PORT=${PORT}
46+
EXPOSE ${PORT}
47+
48+
COPY . /opt/conditional
4449
COPY --from=build-frontend /opt/conditional/conditional/static /opt/conditional/conditional/static
4550

4651
RUN ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
4752

48-
CMD ["gunicorn", "conditional:app", "--bind=0.0.0.0:8080", "--access-logfile=-", "--timeout=256"]
53+
CMD ["sh", "-c", "gunicorn conditional:app --bind=0.0.0.0:${PORT} --access-logfile=- --timeout=256"]

0 commit comments

Comments
 (0)