-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (22 loc) · 1.02 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
FROM node:18.18.0-alpine3.18
WORKDIR /app
COPY ["package.json", "./"]
RUN npm i --force --legacy-peer-deps
RUN npm i esbuild-wasm --legacy-peer-deps
RUN addgroup -S app && adduser -S app -G app
USER app
# FOR DEV environment
# The default "esbuild" failed to run dev server due incompatible platform (BECAUSE I USED ... -v $(pwd):/app ... to run the container)
# RUN npm i esbuild-wasm --legacy-peer-deps OR add "esbuild-wasm": "^0.19.4" to package.json
COPY ["./", "./"]
EXPOSE 5173
EXPOSE 8000
EXPOSE 80
CMD ["yarn", "server:dev"]
# Delete all containers $ docker container rm -f $(docker container ls -aq)
# Build image $ docker build -t chineduogada/ogada-swift-banking-frontend:1 .
# For starting on DEV environment
# Install all deps on the HOST $ npm i --force --legacy-peer-deps
# Start the container $ docker run -d -p 5173:5173 -p 8000:8000 -v $(pwd):/app ogada-swift-banking-frontend:1
# For starting on PROD environment
# Start the container $ docker run -d -p 5173:5173 -p 8000:8000 ogada-swift-banking-frontend:1