-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a9e9f1
commit 3b64cd9
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sample.env | ||
.env | ||
README.md | ||
eslint.config.js | ||
.github | ||
docs | ||
node_modules | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ARG NODE_VERSION=20.16.0 | ||
|
||
FROM node:${NODE_VERSION}-alpine as builder | ||
ENV NODE_ENV production | ||
WORKDIR /app | ||
|
||
# Download dependencies as a separate step to take advantage of Docker's caching. | ||
# Leverage a cache mount to /root/.npm to speed up subsequent builds. | ||
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into | ||
# into this layer. | ||
RUN --mount=type=bind,source=package.json,target=package.json \ | ||
--mount=type=bind,source=package-lock.json,target=package-lock.json \ | ||
--mount=type=cache,target=/root/.npm \ | ||
npm ci --omit=dev | ||
|
||
COPY . . | ||
|
||
FROM node:${NODE_VERSION}-alpine | ||
|
||
WORKDIR /app | ||
USER node | ||
|
||
COPY --from=builder /app . | ||
|
||
ARG PORT=3000 | ||
ENV PORT $PORT | ||
EXPOSE $PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
services: | ||
postgres-ucpa: | ||
image: postgres:15.8-alpine | ||
container_name: ucpa-postgres | ||
networks: | ||
- back | ||
ports: | ||
- '${UCPA_DATABASE_PORT_API:-5466}:5432' | ||
environment: | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
POSTGRES_DB: ucpa_facilitator | ||
env_file: | ||
- .env | ||
|
||
app-ucpa: | ||
build: | ||
context: . | ||
container_name: app-ucpa | ||
command: > | ||
sh -c "env && npm run db:migrate && npm start" | ||
networks: | ||
- back | ||
- web | ||
environment: | ||
NODE_ENV: production | ||
env_file: | ||
- .env | ||
labels: | ||
traefik.enable: true | ||
traefik.docker.network: web | ||
traefik.http.routers.ucpa.rule: Host(`${URL}`) | ||
traefik.http.routers.ucpa.entrypoints: websecure | ||
traefik.http.routers.ucpa.tls: true | ||
traefik.http.routers.ucpa.tls.certresolver: letsencrypt | ||
|
||
networks: | ||
back: | ||
web: | ||
external: true | ||