-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(app): dockerize full app for development
Fixes part of #116
- Loading branch information
Showing
4 changed files
with
61 additions
and
9 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
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 @@ | ||
python manage.py loaddata user_data |
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,21 @@ | ||
version: "3.9" | ||
services: | ||
api: | ||
build: | ||
context: ./api | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- ./api:/home/app/api | ||
ports: | ||
- 8000:8000 | ||
command: python manage.py runserver 0.0.0.0:8000 | ||
ui: | ||
build: | ||
context: ./ui | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- ./ui:/home/app/ui | ||
- /home/app/ui/node_modules | ||
ports: | ||
- 3000:3000 | ||
command: npm run dev -- --host |
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,24 @@ | ||
FROM node:alpine3.16 | ||
|
||
# Set working DIE | ||
WORKDIR /home/app/ui | ||
|
||
# Upgrade Alpine Packages | ||
RUN apk -U upgrade | ||
|
||
# Add bash to run tests and other scripts | ||
RUN apk add --no-cache bash | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json . | ||
|
||
# Install node packages | ||
RUN npm ci | ||
|
||
# Copy rest of code | ||
COPY . . | ||
|
||
# PORT where UI will run in browser | ||
EXPOSE 3000 | ||
|
||
CMD ["npm","run","dev","--","--host"] |