-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (40 loc) · 1.68 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# =============================================================================
# NodeJS Static Assets
# =============================================================================
FROM node:20 as client
RUN mkdir -p /oscarbluelight/server /oscarbluelight/client
WORKDIR /oscarbluelight/client
RUN apt-get update && \
apt-get install -y gettext && \
rm -rf /var/lib/apt/lists/*
# Install node_modules
COPY client/package.json /oscarbluelight/client/package.json
COPY client/package-lock.json /oscarbluelight/client/package-lock.json
RUN npm ci
VOLUME /oscarbluelight/client/node_modules
# Include NPM's .bin directory in the sys path
ENV PATH /oscarbluelight/client/node_modules/.bin:$PATH
# Add source
COPY client/ /oscarbluelight/client/
# Compile static assets
ENV NODE_ENV production
RUN webpack
# Set entry point so that packages are always updated before compiling things
ENTRYPOINT ["/oscarbluelight/client/entrypoint.sh"]
CMD ["webpack", "--watch"]
# =============================================================================
# Python / Django Application Server
# =============================================================================
FROM registry.gitlab.com/thelabnyc/python:py313 as server
RUN mkdir -p /oscarbluelight/server /oscarbluelight/client
WORKDIR /oscarbluelight/server
RUN apt-get update && \
apt-get install -y gettext && \
rm -rf /var/lib/apt/lists/*
COPY server/ /oscarbluelight/server/
RUN poetry install
RUN mkdir /oscarbluelight/tox
ENV TOX_WORK_DIR='/oscarbluelight/tox'
# Set entry point so that packages are always updated before compiling things
ENTRYPOINT ["/oscarbluelight/server/entrypoint.sh"]
CMD ["python", "sandbox/manage.py", "runserver"]