Adds dockerfile
This commit is contained in:
parent
657a4dfb6b
commit
b8ecd1201e
1 changed files with 7 additions and 8 deletions
15
Dockerfile
15
Dockerfile
|
|
@ -25,17 +25,16 @@ RUN mix do deps.get, deps.compile
|
|||
ENV NODE_ENV=production
|
||||
|
||||
# Use Node.js to install assets
|
||||
FROM node:14 AS node-build
|
||||
FROM node:20 AS node-build
|
||||
WORKDIR /app/assets
|
||||
COPY assets/package.json assets/package-lock.json ./
|
||||
RUN npm install
|
||||
COPY assets/package.json assets/pnpm-lock.yaml ./
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm install
|
||||
COPY assets/ ./
|
||||
RUN npm run deploy
|
||||
|
||||
# Switch back to our Elixir image to continue building
|
||||
FROM build AS app-build
|
||||
WORKDIR /app
|
||||
COPY --from=node-build /app/assets/build ./priv/static
|
||||
RUN mix phx.digest
|
||||
|
||||
# Copy our application source code
|
||||
|
|
@ -60,8 +59,8 @@ USER app
|
|||
WORKDIR /home/app
|
||||
|
||||
# Copy over the build artifact from the previous step and create a symlink
|
||||
COPY --from=build --chown=app:app /app/_build/prod/rel/ezcontainer_railway ./
|
||||
RUN ln -s /home/app/ezcontainer_railway/bin/ezcontainer_railway /home/app/bin
|
||||
COPY --from=app-build --chown=app:app /app/_build/prod/rel/ezcontainer_railway ./
|
||||
RUN ln -s /home/app/_build/prod/rel/ezcontainer_railway/bin/ezcontainer_railway /home/app/bin/app
|
||||
|
||||
# Specify the entry point
|
||||
ENTRYPOINT ["bin/my_app", "start"]
|
||||
ENTRYPOINT ["bin/app", "start"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue