There are two variants of Dockerfile used for both backend and frontend:
- Production (
Dockerfile)- Installs only packages required in production (no devDependencies)
- Copies only required files to the image
- Tries to be minimal so the image would be fast and small
- Development (
dev.Dockerfile)- Installs all packages from
package.json - Copies all files from
backendto the image (not counting.dockerignored files) - Has multiple stages (dev and api-tests)
- Learn more about multi-stage Dockerfiles: https://docs.docker.com/build/building/multi-stage/
- Includes everything that is required / helps with development and testing
- Installs all packages from
There are three variants of docker compose used in this project.
- Production (
docker-compose.yml)- Uses
{backend,frontend}/Dockerfilefor both backend and frontend - Uses
.envfor environment variables - Uses
datafor database initialization - Doesn't start phpMyAdmin
- Can be started with
npm run start
- Uses
- Dev (
docker-compose.dev.yml)- Uses
{backend,frontend}/dev.Dockerfile - Uses
.dev.env - Uses
datafor database initialization - Can be started with
npm run dev
- Uses
- Anon (
docker-compose.anon.yml)- Uses
{backend,frontend}/dev.Dockerfile - Uses
.anon.env - Uses
test_datafor database initialization - Can be started with
npm run start:anon
- Uses