Last active
July 1, 2023 21:24
-
-
Save developerfred/6da6823a02d6f7302cb7b474847b43ad to your computer and use it in GitHub Desktop.
programatrava - umbrella on Elixir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://twitter.com/programatrava/status/1675246821717803014 | |
version: '3.1' | |
services: | |
app: | |
build: . | |
depends_on: | |
- db | |
ports: | |
- "4000:4000" | |
db: | |
image: postgres:13 | |
environment: | |
- POSTGRES_PASSWORD=postgres | |
- POSTGRES_USER=postgres | |
- POSTGRES_DB=myapp | |
volumes: | |
- ./data/db:/var/lib/postgresql/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We start from a Elixir base image | |
FROM elixir:1.12 | |
# Create app directory and copy the Elixir projects into it | |
RUN mkdir /app | |
COPY . /app | |
WORKDIR /app | |
# Install hex and rebar | |
RUN mix local.hex --force && \ | |
mix local.rebar --force | |
# Set the environment to prod | |
ENV MIX_ENV=prod | |
# Install dependencies | |
RUN mix deps.get --only prod | |
# Compile the project | |
RUN mix compile | |
# Expose the port | |
EXPOSE 4000 | |
# Run the command to start the Phoenix server | |
CMD ["mix", "phx.server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment