docker
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
FROM node:24-alpine AS production
|
||||||
|
ARG NODE_ENV=production
|
||||||
|
ENV NODE_ENV=${NODE_ENV}
|
||||||
|
#Install curl for healthcheck
|
||||||
|
RUN apk add -U tzdata
|
||||||
|
ENV TZ=Europe/Zurich
|
||||||
|
RUN cp /usr/share/zoneinfo/Europe/Zurich /etc/localtime
|
||||||
|
RUN apk add --no-cache tini curl
|
||||||
|
HEALTHCHECK CMD curl -f http://localhost:3000/api/health || exit 1
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install --only=production
|
||||||
|
COPY . .
|
||||||
|
CMD ["node", "server.js"]
|
||||||
|
|
||||||
|
# docker build -t pg-middle-api:1.0 . && docker tag pg-middle-api:1.0 docker.imep.net/pg-middle-api:1.0 && docker push docker.imep.net/pg-middle-api:1.0
|
||||||
|
|
||||||
|
|
||||||
Generated
+6
-6
@@ -598,9 +598,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-to-regexp": {
|
"node_modules/path-to-regexp": {
|
||||||
"version": "8.3.0",
|
"version": "8.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
||||||
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
|
"integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@@ -749,9 +749,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.14.1",
|
"version": "6.15.1",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.1.tgz",
|
||||||
"integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
|
"integrity": "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"side-channel": "^1.1.0"
|
"side-channel": "^1.1.0"
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
pg-api:
|
||||||
|
image: docker.imep.net/pg-middle-api:1.0
|
||||||
|
ports:
|
||||||
|
- 3133:3000
|
||||||
|
environment:
|
||||||
|
- DEBUG=sample-express:*
|
||||||
|
networks:
|
||||||
|
- traefik-public
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
- 'traefik.enable=true'
|
||||||
|
- 'traefik.http.routers.pg-api.rule=Host(`pg-api.dsaihost.com`)'
|
||||||
|
- 'traefik.http.routers.pg-api.middlewares=pg-api-stripprefix,pg-api-header'
|
||||||
|
- 'traefik.http.routers.pg-api.entrypoints=websecure'
|
||||||
|
- 'traefik.http.routers.pg-api.tls.certresolver=letsencryptresolver'
|
||||||
|
- 'traefik.http.services.pg-api.loadbalancer.server.port=3000'
|
||||||
|
- 'traefik.http.middlewares.pg-api-header.headers.accesscontrolallowmethods=GET,OPTIONS,PUT'
|
||||||
|
- 'traefik.http.middlewares.pg-api-header.headers.accesscontrolallowheaders=*'
|
||||||
|
- 'traefik.http.middlewares.pg-api-header.headers.accesscontrolalloworiginlist=*'
|
||||||
|
- 'traefik.http.middlewares.pg-api-header.headers.accesscontrolmaxage=100'
|
||||||
|
- 'traefik.http.middlewares.pg-api-header.headers.addvaryheader=true'
|
||||||
|
- 'traefik.http.middlewares.pg-api-header.headers.contentSecurityPolicy=default-src all dsaihost.com'
|
||||||
|
update_config:
|
||||||
|
order: start-first
|
||||||
|
failure_action: rollback
|
||||||
|
delay: 10s
|
||||||
|
rollback_config:
|
||||||
|
parallelism: 0
|
||||||
|
order: stop-first
|
||||||
|
restart_policy:
|
||||||
|
condition: any
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 3
|
||||||
|
window: 120s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik-public:
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user