creates database correctly
This commit is contained in:
parent
e8b528e5f0
commit
5ef40852a6
2 changed files with 9 additions and 6 deletions
12
Dockerfile
12
Dockerfile
|
|
@ -27,26 +27,26 @@ ENV NODE_ENV=production
|
|||
# Use Node.js to install assets
|
||||
FROM node:20 AS node-build
|
||||
WORKDIR /app/assets
|
||||
COPY assets/package.json assets/pnpm-lock.yaml ./
|
||||
COPY assets .
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm install
|
||||
COPY assets/ ./
|
||||
|
||||
# Switch back to our Elixir image to continue building
|
||||
FROM build AS app-build
|
||||
WORKDIR /app
|
||||
RUN mix ecto.create
|
||||
RUN mix ecto.migrate
|
||||
RUN mix phx.digest
|
||||
|
||||
# Copy our application source code
|
||||
COPY --from=node-build /app/assets assets
|
||||
COPY lib lib
|
||||
COPY priv priv
|
||||
|
||||
# Compile and build the application
|
||||
RUN mix do compile, phx.digest
|
||||
RUN mix do compile, phx.digest, assets.deploy, ecto.create, ecto.migrate
|
||||
|
||||
# Create the release
|
||||
RUN mix phx.gen.release
|
||||
|
||||
RUN mix release
|
||||
|
||||
# ---- Application Stage ----
|
||||
|
|
@ -62,6 +62,8 @@ WORKDIR /home/app
|
|||
|
||||
# Copy over the build artifact from the previous step and create a symlink
|
||||
COPY --from=app-build --chown=app:app /app/_build/prod/rel/ezcontainer_railway ./
|
||||
COPY --from=app-build --chown=app:app /app/_build/prod/lib/ezcontainer_railway/priv/static priv/static
|
||||
COPY --from=app-build --chown=app:app /app/db ./db
|
||||
|
||||
# Specify the entry point
|
||||
ENTRYPOINT ["/home/app/bin/ezcontainer_railway", "start"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue