-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (38 loc) · 1.52 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
# =============================================================================
# NodeJS Static Assets
# =============================================================================
FROM node:20 as client
RUN mkdir -p /oscarbundles/server /oscarbundles/client
WORKDIR /oscarbundles/client
RUN apt-get update && \
apt-get install -y gettext && \
rm -rf /var/lib/apt/lists/*
# Install node_modules
ADD client/package.json /oscarbundles/client/package.json
ADD client/package-lock.json /oscarbundles/client/package-lock.json
RUN npm ci
VOLUME /oscarbundles/client/node_modules
# Include NPM's .bin directory in the sys path
ENV PATH /oscarbundles/client/node_modules/.bin:$PATH
# Add source
ADD client/ /oscarbundles/client/
# Compile static assets
ENV NODE_ENV production
RUN webpack
# Set entry point so that packages are always updated before compiling things
ENTRYPOINT ["/oscarbundles/client/entrypoint.sh"]
CMD ["webpack", "--watch"]
# =============================================================================
# Python / Django Application Server
# =============================================================================
FROM registry.gitlab.com/thelabnyc/python:py313 as server
RUN mkdir -p /oscarbundles/server /oscarbundles/client
WORKDIR /oscarbundles/server
RUN apt-get update && \
apt-get install -y gettext && \
rm -rf /var/lib/apt/lists/*
COPY server/ /oscarbundles/server/
RUN poetry install
RUN mkdir /oscarbundles/tox
ENV TOX_WORK_DIR='/oscarbundles/tox'
CMD ["python", "sandbox/manage.py", "runserver"]