Skip to content

Instantly share code, notes, and snippets.

@dreadfullyposh
Created March 24, 2020 12:47
Show Gist options
  • Save dreadfullyposh/5f8a0cbea4d147c5a087bec861380ef1 to your computer and use it in GitHub Desktop.
Save dreadfullyposh/5f8a0cbea4d147c5a087bec861380ef1 to your computer and use it in GitHub Desktop.
Example using Docker multi-stage builds
version: '3.7'
services:
web:
build:
context: ./web/docker
target: prod # set the named target here
# Dev - name the stage with `as dev`
FROM confluxgroup/php-nginx:7.4 as dev
RUN add-apt-repository -y ppa:ondrej/php \
&& apt-get update -y \
&& apt-get install php7.4-sqlite3 -y \
&& rm -rf /var/lib/apt/lists/*
# Production - name the stage with `as prod`
FROM dev as prod
ADD ./redirects.conf /etc/nginx/sites-enabled/
ADD ./expires.conf /etc/nginx/include.d/
ADD ./compression.conf /etc/nginx/include.d/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment