Skip to content

Commit 7720cdd

Browse files
committed
Create dockerfile.dev for local docker-compose
1 parent 7dd1b1e commit 7720cdd

File tree

3 files changed

+77
-25
lines changed

3 files changed

+77
-25
lines changed

Dockerfile

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ ENV RUN_JOBS=false
1919
# set the default db to the one we'd see in the docker compose
2020
ENV CORE_DB_CONNECTION_STRING=postgresql://postgres:root@postgres:5432/deep_lynx_dev
2121

22-
# Add missing packages
23-
RUN apk --no-check-certificate add wget ca-certificates
24-
25-
# Configure INL certs and environment variables
26-
RUN wget -q -P /usr/local/share/ca-certificates/ http://certstore.inl.gov/pki/CAINLROOT_B64.crt
27-
RUN /usr/sbin/update-ca-certificates
28-
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
29-
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
30-
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
31-
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
32-
ENV SSL_CERT_DIR=/etc/ssl/certs/
33-
3422
RUN apk update
3523
RUN apk add --no-cache build-base musl-dev openssl openssl-dev
3624
RUN apk update add --update nodejs=21.7.3
@@ -61,18 +49,6 @@ RUN yarn run build;
6149
FROM node:alpine as production
6250
ENV DEVELOPMENT_MODE=false
6351

64-
# Add missing packages
65-
RUN apk --no-check-certificate add wget ca-certificates
66-
67-
# Configure INL certs and environment variables
68-
RUN wget -q -P /usr/local/share/ca-certificates/ http://certstore.inl.gov/pki/CAINLROOT_B64.crt
69-
RUN /usr/sbin/update-ca-certificates
70-
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
71-
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
72-
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
73-
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
74-
ENV SSL_CERT_DIR=/etc/ssl/certs/
75-
7652
RUN apk update && apk add --no-cache supervisor openssl
7753
RUN mkdir -p /srv/deeplynx/server
7854

Dockerfile.dev

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM rust:alpine as build
2+
3+
ENV RUSTFLAGS="-C target-feature=-crt-static"
4+
ENV RUN_MODE="build"
5+
# these settings are needed for the admin web gui build, these variables are all baked into the Vue application and thus
6+
# are available to any end user that wants to dig deep enough in the webpage - as such we don't feel it a security risk
7+
# to have these env variables available to anyone running the history commmand on the container/image
8+
ENV VUE_APP_BUNDLED_BUILD="true"
9+
ENV VUE_APP_DEEP_LYNX_API_URL="http://localhost:8090"
10+
ENV VUE_APP_DEEP_LYNX_API_AUTH_METHOD="token"
11+
ENV VUE_APP_TIME_SERIES_ENABLED="true"
12+
# you must include the trailing /# - because the bundled admin web app will be in hash mode, not history
13+
ENV VUE_APP_APP_URL="http://localhost:8090/#"
14+
# this should be an alphanumeric random string of at least 15 characters
15+
ENV VUE_APP_DEEP_LYNX_APP_ID="root"
16+
17+
# turn off jobs on the main thread as this spins up PM2 with the worker
18+
ENV RUN_JOBS=false
19+
# set the default db to the one we'd see in the docker compose
20+
ENV CORE_DB_CONNECTION_STRING=postgresql://postgres:root@postgres:5432/deep_lynx_dev
21+
22+
# Add missing packages
23+
RUN apk --no-check-certificate add wget ca-certificates
24+
25+
# Configure certs below
26+
27+
28+
RUN apk update
29+
RUN apk add --no-cache build-base musl-dev openssl openssl-dev
30+
RUN apk update add --update nodejs=21.7.3
31+
RUN apk add --update npm
32+
RUN npm config set strict-ssl false
33+
# Install corepack separately so it is found during builds.
34+
RUN npm install -g corepack @napi-rs/cli # this is needed for the Rust/Node library interopt
35+
RUN npm install npm@latest --location=global
36+
RUN npm update --location=global
37+
RUN npm install cargo-cp-artifact --location=global
38+
RUN corepack enable # enables the yarn commands
39+
40+
RUN mkdir -p /srv/deeplynx
41+
WORKDIR /srv/deeplynx
42+
43+
44+
COPY . .
45+
46+
# triple check we're not pulling in node_modules from the host system
47+
RUN rm -rf /srv/deeplynx/server/node_modules
48+
RUN rm -rf /srv/deeplynx/ui/AdminWebApp/node_modules
49+
RUN rm -rf /srv/deeplynx/ui/WebGLViewer/node_modules
50+
51+
WORKDIR /srv/deeplynx/server
52+
RUN yarn install;
53+
RUN yarn run build;
54+
55+
FROM node:alpine as production
56+
ENV DEVELOPMENT_MODE=false
57+
58+
# Add missing packages
59+
RUN apk --no-check-certificate add wget ca-certificates
60+
61+
# Configure certs below
62+
63+
64+
RUN apk update && apk add --no-cache supervisor openssl
65+
RUN mkdir -p /srv/deeplynx/server
66+
67+
# need pm2 to run legacy server
68+
RUN npm install npm@latest --location=global
69+
RUN npm update --location=global
70+
RUN npm install pm2 --location=global
71+
72+
COPY --from=build /srv/deeplynx/server /srv/deeplynx/server
73+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
74+
75+
EXPOSE 8090
76+
CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

docker-compose.local.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.9"
22
services:
33
deep-lynx:
44
build:
5-
dockerfile: Dockerfile
5+
dockerfile: Dockerfile.dev
66
restart: on-failure
77
depends_on:
88
- postgres

0 commit comments

Comments
 (0)