-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* created api.Dockerfile for the fox-deck-api * created app.Dockerfile for the fox-deck-app * create docker-compose.yml for connecting both apps via network * use 'bcryptjs' instead of 'bcrypt'
- Loading branch information
1 parent
ca37316
commit 394a694
Showing
8 changed files
with
62 additions
and
2 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 @@ | ||
node_modules |
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,10 @@ | ||
FROM node:20.11.1-alpine3.19 as api-stage | ||
WORKDIR /usr/src/app | ||
COPY apps/fox-deck-api/package*.json ./ | ||
RUN npm ci --prefer-offline --no-audit --progress=false | ||
COPY apps/fox-deck-api/ . | ||
COPY apps/fox-deck-api/.env.example /usr/src/app/.env | ||
RUN npm rebuild # Rebuilds all native dependencies, used because we use c++ libraries | ||
RUN npm run prisma:migrate | ||
EXPOSE 3000 | ||
CMD ["npm", "run", "start:dev"] |
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,11 @@ | ||
FROM node:20.11.1-alpine3.19 as build-stage | ||
WORKDIR /app | ||
COPY apps/fox-deck-app/package*.json ./ | ||
RUN npm install --prefer-offline --no-audit --progress=false | ||
COPY apps/fox-deck-app/ . | ||
RUN npm run build | ||
FROM nginx:alpine as production-stage | ||
COPY --from=build-stage /app/dist /usr/share/nginx/html | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY apps/fox-deck-app/nginx.conf /etc/nginx/conf.d/ | ||
EXPOSE 80 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,17 @@ | ||
server { | ||
listen 80; | ||
|
||
location /api/ { | ||
proxy_pass http://fox-deck-api:3000/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
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,15 @@ | ||
version: '3.8' | ||
|
||
services: | ||
fox-deck-app: | ||
build: | ||
context: . | ||
dockerfile: app.Dockerfile | ||
ports: | ||
- "80:80" | ||
fox-deck-api: | ||
build: | ||
context: . | ||
dockerfile: api.Dockerfile | ||
ports: | ||
- "3000:3000" |