Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Diskuy-Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mohammad Dwikurnia Apriadi
Diskuy-Backend
Commits
e77b48bb
Commit
e77b48bb
authored
4 years ago
by
Muhammad Rafif Elfazri
Browse files
Options
Downloads
Patches
Plain Diff
Create DockerFile for building diskuy image backend
parent
69f05288
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+59
-0
59 additions, 0 deletions
Dockerfile
with
59 additions
and
0 deletions
Dockerfile
0 → 100644
+
59
−
0
View file @
e77b48bb
# File: docker_phx/Dockerfile
FROM
elixir:1.9-alpine
as
build
# install build dependencies
RUN
apk add
--update
git build-base nodejs npm yarn python
RUN
mkdir
/app
WORKDIR
/app
# install Hex + Rebar
RUN
mix
do
local.hex
--force
, local.rebar
--force
# set build ENV
ENV
MIX_ENV=prod
# install mix dependencies
COPY
mix.exs mix.lock ./
COPY
config config
RUN
mix deps.get
--only
$MIX_ENV
RUN
mix deps.compile
# build assets
# COPY assets assets
# RUN cd assets && npm install && npm run deploy
# RUN mix phx.digest
# build project
COPY
priv priv
COPY
lib lib
RUN
mix compile
# build release
# at this point we should copy the rel directory but
# we are not using it so we can omit it
# COPY rel rel
RUN
mix release
# prepare release image
FROM
alpine:3.9
AS
app
# install runtime dependencies
RUN
apk add
--update
bash openssl postgresql-client
EXPOSE
4000
ENV
MIX_ENV=prod
# prepare app directory
RUN
mkdir
/app
WORKDIR
/app
# copy release to app container
COPY
--from=build /app/_build/prod/rel/docker_phx .
COPY
entrypoint.sh .
RUN
chown
-R
nobody: /app
USER
nobody
ENV
HOME=/app
CMD
["bash", "/app/entrypoint.sh"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment