forked from SFDO-Tooling/MetaDeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.1 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
FROM ghcr.io/oddbird/pyjs:py3.9-node16
ARG BUILD_ENV=development
ARG PROD_ASSETS
WORKDIR /app
# Env setup:
ENV PYTHONPATH /app
ENV DJANGO_SETTINGS_MODULE config.settings.production
# Install sfdx
RUN npm install --location=global sfdx-cli --ignore-scripts
# Python requirements:
COPY ./requirements requirements
RUN pip install --no-cache-dir --upgrade pip pip-tools \
&& pip install --no-cache-dir -r requirements/prod.txt
RUN if [ "${BUILD_ENV}" = "development" ] ; then \
pip install --no-cache-dir -r requirements/dev.txt; \
fi
# JS client setup:
COPY ./package.json package.json
COPY ./yarn.lock yarn.lock
RUN yarn install --check-files
COPY . /app
# Avoid building prod assets in development
RUN if [ "${BUILD_ENV}" = "production" ] || [ -n "${PROD_ASSETS}" ] ; then yarn prod ; else mkdir -p dist/prod ; fi
RUN \
DB_ENCRYPTION_KEY="Ul-OySkEawSxUc7Ck13Twu2109IzIFh54C1WXO9KAFE=" \
GITHUB_TOKEN="sample token" \
SFDX_CLIENT_SECRET="sample secret" \
SFDX_CLIENT_CALLBACK_URL="sample callback" \
SFDX_CLIENT_ID="sample id" \
python manage.py collectstatic --noinput
CMD /app/start-server.sh