-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDevDockerfile
27 lines (21 loc) · 1.12 KB
/
DevDockerfile
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
# N.B.:
# - Jammy is a specific Ubuntu version
# - Change "CURRENT_ENVIRONMENT" variable in ".env" to change the environment in the development container
FROM swift:6.0.3-jammy AS build
# Install OS updates and required binaries
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y nodejs \
&& apt-get install -y npm
# Install nodemon (used for hot reloading)
RUN npm install -g nodemon && apt-get remove npm -y
WORKDIR /app
EXPOSE ${DEV_CONTAINER_PORT}
# 1. Build app
# 2. Hot reload application
# - Watch the current directory ("-w ./")
# - Only watch for files with ".swift" extentsion ("-e swift")
# - Ignore build so that it does not hot reload recursively ("--ignore ./.build")
# - Specify execution command, it will stop the app and rerun this command each time something changes ("'swift run App serve --hostname 0.0.0.0 --port 8080'")
CMD bash -c "nodemon -w ./ -w .env -e '.' --ignore ./.build --exec 'swift run App serve --env $CURRENT_ENVIRONMENT --hostname 0.0.0.0 --port $DEV_CONTAINER_PORT'"