creates database correctly

This commit is contained in:
benbot 2023-10-27 10:14:51 -04:00
parent e8b528e5f0
commit 5ef40852a6
2 changed files with 9 additions and 6 deletions

View file

@ -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"]

View file

@ -10,10 +10,11 @@ config :ezcontainer_railway, EzcontainerRailway.Repo,
# The watchers configuration can be used to run external
# watchers to your application. For example, we can use it
# to bundle .js and .css sources.
port = String.to_integer(System.get_env("PORT") || "4000")
config :ezcontainer_railway, EzcontainerRailwayWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {127, 0, 0, 1}, port: 4000],
http: [ip: {0, 0, 0, 0}, port: port],
check_origin: false,
code_reloader: true,
debug_errors: true,