Fix docker development:

- Specify elixir version (1.15) in Dockerfile base image

- Add npm package to Dockerfile

- Fix vite server unreachable from outside the docker container:
  issue https://framagit.org/framasoft/mobilizon/-/issues/1225
This commit is contained in:
summersamara 2023-11-22 20:57:50 +01:00
parent 797eb2334b
commit 970597876b
3 changed files with 7 additions and 2 deletions

View file

@ -1,9 +1,10 @@
FROM elixir:alpine FROM elixir:1.15-alpine
RUN apk add --no-cache inotify-tools postgresql-client file make gcc libc-dev argon2 imagemagick cmake build-base libwebp-tools bash ncurses git python3 RUN apk add --no-cache inotify-tools postgresql-client file make gcc libc-dev argon2 imagemagick cmake build-base libwebp-tools bash ncurses git python3 npm
RUN mix local.hex --force && mix local.rebar --force RUN mix local.hex --force && mix local.rebar --force
WORKDIR /app WORKDIR /app
EXPOSE 4000 EXPOSE 4000
EXPOSE 5173

View file

@ -19,6 +19,7 @@ services:
- ".:/app" - ".:/app"
ports: ports:
- 4000:4000 - 4000:4000
- 5173:5173
depends_on: depends_on:
- postgres - postgres
environment: environment:

View file

@ -83,6 +83,9 @@ export default defineConfig(({ command }) => {
return { return {
plugins, plugins,
build, build,
server: {
host: isDev ? "0.0.0.0" : "localhost",
},
resolve: { resolve: {
alias: { alias: {
"@": path.resolve(__dirname, "./src"), "@": path.resolve(__dirname, "./src"),