You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the web server, I have the following dockerfile (which is in the repo's root directory). It basically copies all server files to the docker container, then installs packages and runs the server (by default on port 3000) and exposes port 3000 to outside of the docker container.
FROM node:alpine
WORKDIR /usr/src/app
COPY . ./
RUN npm install
RUN npm run build-ts
EXPOSE 3000
CMD ["npm", "start"]
For the database, I have the following dockerfile. You can change the COPY ./sql-scripts/ ... to wherever the create_db.sql script is (and any other SQL scripts that should be executed when the container is started).
Feel free to use or change these dockerfiles as you see fit.
So the task now is:
write a docker compose script that runs web server and database in a way that the server can read the database.
make sure changes to the database are persisted somehow - so we don't lost any data when the docker container is stopped (probably by mounting a volume to the docker container).
clean up the repository with the new docker config files and make a pull request!
The text was updated successfully, but these errors were encountered:
For the web server, I have the following dockerfile (which is in the repo's root directory). It basically copies all server files to the docker container, then installs packages and runs the server (by default on port 3000) and exposes port 3000 to outside of the docker container.
which I build and run with the following:
For the database, I have the following dockerfile. You can change the
COPY ./sql-scripts/ ...
to wherever thecreate_db.sql
script is (and any other SQL scripts that should be executed when the container is started).This one I run with
Feel free to use or change these dockerfiles as you see fit.
So the task now is:
The text was updated successfully, but these errors were encountered: