-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
49 lines (34 loc) · 1.37 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
# Build node image from Node Docker Hub
FROM node:16
# Set node environment as docker-build
ENV NODE_ENV="docker-build"
# Make app directory in container
RUN mkdir /app
# Identify working directory
WORKDIR /app
# Copy over app to app folder
COPY . /app
# Install rpm packages from package.json
RUN npm install --force
# Reset node environment variable
ENV NODE_ENV=""
# Run the app as a non-privileged user
RUN chown -R 1001:0 . && chmod -R gu+s+rw .
USER 1001
# Expose server at port ( accessible outside of container)
EXPOSE 8080
# Start app. Need to run setup first to prepare the app for production
CMD node setup.js && node server/server.js
# To build, use the following command:
# docker build .
# To build for Open Shift (from Apple Pro M1), use the following command:
# docker build --platform=linux/amd64 .
# To run, use the following command:
# docker run -it -d -P --name wizard --env OIDC_CLIENT_SECRET=$OIDC_CLIENT_SECRET <IMAGE ID>
# To push to EBRAINS Docker registry
# docker login docker-registry.ebrains.eu
# docker image tag <image id> docker-registry.ebrains.eu/<project_name>/<repository_name>:<tag>
# docker push docker-registry.ebrains.eu/<project_name>/<repository_name>:<tag>
# Example:
# docker image tag ddb2fe9a8083 docker-registry.ebrains.eu/ebrains_wizard_test/wizard_dev:0.1.2
# docker push docker-registry.ebrains.eu/ebrains_wizard_test/wizard_dev:0.1.2