Skip to content

Commit

Permalink
Adiciona build como padrão no docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
lpirola committed Jul 10, 2024
1 parent 681c486 commit 9175a9b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 32 deletions.
26 changes: 13 additions & 13 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

# Adapted from https://github.com/dunglas/symfony-docker

# FROM node:20 as frontend_build

# # user: "node"
# WORKDIR /app
# # environment:
# ENV NODE_ENV=development
# COPY . /app
# WORKDIR /app/mapas/src
# RUN npm i -g pnpm
# RUN pnpm i
# RUN pnpm run dev
FROM node:20 as frontend_build

# user: "node"
WORKDIR /app
# environment:
ENV NODE_ENV=development
COPY --link . /app
WORKDIR /app/mapas/src
RUN npm i -g pnpm
RUN pnpm i

Check failure on line 14 in api/Dockerfile

View workflow job for this annotation

GitHub Actions / Docker Lint

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
RUN pnpm run dev

Check failure on line 15 in api/Dockerfile

View workflow job for this annotation

GitHub Actions / Docker Lint

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

# Versions
FROM dunglas/frankenphp:1-php8.3 AS frankenphp_upstream
Expand All @@ -29,7 +29,7 @@ FROM frankenphp_upstream AS frankenphp_base
WORKDIR /app

# COPY --link . /app
# COPY --link --from=frontend_build /app /app
COPY --link --from=frontend_build /app /app

# persistent / runtime deps
# hadolint ignore=DL3008
Expand Down Expand Up @@ -67,7 +67,7 @@ FROM frankenphp_base AS frankenphp_dev

ENV APP_ENV=dev XDEBUG_MODE=off
# VOLUME /app/var/
COPY --link . /app
# COPY --link . /app

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

Expand Down
47 changes: 28 additions & 19 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
x-defaults: &defaults
build:
context: ./api
target: frankenphp_dev

# volumes:
# - ./api:/app

environment: &environment
PWA_UPSTREAM: ${PWA_UPSTREAM}
SERVER_NAME: ${SERVER_NAME}
Expand Down Expand Up @@ -31,11 +38,8 @@ services:
- db-update
environment:
<<: *environment
# build:
# context: ./api
# target: frankenphp_dev
ports:
- 5020:80
- 80
volumes:
# - ./api:/app
# - /app/var
Expand All @@ -45,16 +49,18 @@ services:
# - ./api/frankenphp/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
- caddy_data:/data
- caddy_config:/config
# pgadmin:
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
# PGADMIN_CONFIG_SERVER_MODE: 'False'
# volumes:
# - pgadmin:/var/lib/pgadmin
# ports:
# - 5050:80

pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- 80

crontab:
image: rancher/container-crontab:v0.5.0
restart: '${DOCKER_RESTART_POLICY:-always}'
Expand Down Expand Up @@ -108,19 +114,20 @@ services:
command: --maxmemory 128Mb --maxmemory-policy allkeys-lru
volumes:
- redis:/data

ports:
- 6379
sessions:
image: redis:6
restart: unless-stopped
command: --maxmemory 128Mb --maxmemory-policy allkeys-lru
volumes:
- sessions:/data

ports:
- 6379
mailhog:
image: mailhog/mailhog
# ports:
# - "8025:8025"

ports:
- 8025
# pwa:
# image: redemapas/mapas-pwa
# build:
Expand All @@ -145,6 +152,8 @@ services:
#- ./api/mapas/dev/db:/docker-entrypoint-initdb.d
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./api/docker/db/data:/var/lib/postgresql/data
ports:
- 5432
healthcheck:
test: "PGPASSWORD=${POSTGRES_PASSWORD} pg_isready -h 127.0.0.1 -U ${POSTGRES_USER} -d ${POSTGRES_DB}"

Expand Down

0 comments on commit 9175a9b

Please sign in to comment.